package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {

    @Insert("insert into clazz(name, room, begin_date, end_date, master_id, subject, create_time, update_time) " +
            "VALUES(#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime}) ")
    Integer addClazz(Clazz clazz);

    @Select("select * from clazz")
    List<Clazz> findAll();

    List<Clazz> page(ClazzQueryParam clazzQueryParam);

    //@Delete("delete from clazz where id = #{id}")
    Integer deleteById(Integer id);

    Clazz selectById(Integer id);

    void updateClazz(Clazz clazz);
}
